#include <cmath>
#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
#include <map>
#include <set>
#include <cstring>
#define endl "\n"
using namespace std;
int main()
{
	int N, n, a[3], mi, ma;
	cin >> N;
	while (N--)
	{
		cin >> a[0] >> a[1] >> a[2];
		mi = min({ a[0],a[1],a[2] });
		ma = max({ a[0],a[1],a[2] });
		for (int i = 0; i < 3; i++)
		{
			if (a[i] != mi && a[i] != ma)
			{
				cout << a[i] << endl;
			}
		}
	}
	return 0;
}